home *** CD-ROM | disk | FTP | other *** search
- head 1.10;
- branch ;
- access ;
- symbols ;
- locks ; strict;
- comment @@;
-
-
- 1.10
- date 92.06.10.13.04.34; author jhh; state Exp;
- branches ;
- next 1.9;
-
- 1.9
- date 89.10.09.21.28.00; author rab; state Exp;
- branches ;
- next 1.8;
-
- 1.8
- date 88.11.10.15.23.59; author ouster; state Exp;
- branches ;
- next 1.7;
-
- 1.7
- date 88.08.20.18.09.37; author ouster; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 88.08.20.12.40.48; author ouster; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 88.08.13.15.07.56; author ouster; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 88.08.12.14.38.33; author ouster; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 88.07.21.11.35.07; author douglis; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 88.07.20.10.22.28; author ouster; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 88.06.21.16.04.58; author ouster; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.10
- log
- @make sure all makefiles include TYPE
- @
- text
- @#!/sprite/cmds/csh -f
- #
- # A script to generate (or regenerate) the Makefile for a directory
- # consisting solely of header files.
- #
- # We assume we were invoked from mkmf. Parameters passed in from mkmf
- # through environment variables:
- #
- # MKMFDIR directory containing prototype makefiles
- # MAKEFILE name of makefile to create
- # SUBTYPE additional information, telling whether this
- # is an X directory, Sprite directory, etc.
- #
-
- #
- # Argument processing. (Generalized form, even though just one flag so far.)
- #
- while ($#argv >= 1)
- if ("$1" == '-x') then
- set echo
- endif
- shift
- end
-
- set subtype=$SUBTYPE
- set tmp=`expr $cwd : '.*/\(include.*\)$'`
- switch ($subtype)
- case sprite:
- set includedir=/sprite/lib/$tmp
- breaksw
- case x:
- set includedir=/a/X/lib/$tmp
- breaksw
- default:
- echo Unknown header subtype "$subtype"
- exit 1
- endsw
- set pref='[a-z_A-Z]'
- set makefile=$MAKEFILE
-
- if (-e $makefile.proto) then
- set proto=$makefile.proto
- else
- set proto="${MKMFDIR}/Makefile.hdrs"
- endif
-
- echo "Generating a Makefile for $includedir headers using $proto"
-
- set nonomatch
- set hdrs =( ${pref}*.h )
- #
- # Check to see if there were any headers. The first check (size == 1)
- # is only necessary because the second check will cause an error if
- # hdrs contains more than 1024 bytes.
- #
- if ($#hdrs == 1) then
- if ("$hdrs" == "${pref}*.h") set hdrs=()
- endif
- unset nonomatch
- set subDirs="`find * -type d ! -name RCS -prune -print`"
- set distdir=($DISTDIR)
-
- #
- # Use sed to substitute various interesting things into the prototype
- # makefile. The code below is a bit tricky because some of the variables
- # being substituted in can be very long: if the substitution is passed
- # to sed with "-e", the entire variable must fit in a single shell argument,
- # with a limit of 1024 characters. By generating a separate script file
- # for the very long variables, the variables get passed through (to the
- # script file) as many arguments, which gets around the length problem.
- #
-
- rm -f mkmf.tmp.sed
- echo s,"@@(HDRS)",$hdrs,g > mkmf.tmp.sed
- cat $proto | sed -f mkmf.tmp.sed \
- -e "s,@@(DATE),`date`,g" \
- -e "s,@@(INCLUDEDIR),$includedir,g" \
- -e "s,@@(MAKEFILE),$makefile,g" \
- -e "s,@@(SUBDIRS),$subDirs,g" \
- -e "s,@@(TEMPLATE),$proto,g" \
- -e "s,@@(DISTDIR),$distdir,g" \
- -e "s,@@(TYPE),$subtype,g" \
- > $makefile
- rm -f mkmf.tmp.sed
- @
-
-
- 1.9
- log
- @Modifications for distribution.
- @
- text
- @d82 1
- @
-
-
- 1.8
- log
- @Minor cleanup.
- @
- text
- @d61 1
- d81 1
- @
-
-
- 1.7
- log
- @Handle header subdirectories better.
- @
- text
- @d75 1
- d77 1
- a78 1
- -e "s,@@(MAKEFILE),$makefile,g" \
- a79 1
- -e "s,@@(DATE),`date`,g" \
- @
-
-
- 1.6
- log
- @Don't allow symbolic link in install path: kernel causes problems.
- @
- text
- @d26 1
- a28 1
- set tmp=`expr $cwd : '.*/\(include.*\)$'`
- d32 1
- a32 1
- set includedir=/a/X/lib/include
- @
-
-
- 1.5
- log
- @Set up for X stuff.
- @
- text
- @d32 1
- a32 1
- set includedir=/X/lib/include
- @
-
-
- 1.4
- log
- @No need to look for MAKEFILE or MACHINES. Also, be more restrictive
- on which headers are exported.
- @
- text
- @d11 2
- a13 5
- # Variables generated here:
- # makefile name of the makefile to create
- # pref prefix pattern that files must match to be included
- # proto name of prototype makefile to use to create $makefile
- #
- d25 13
- a37 3
-
- set type=`expr $cwd : '.*/\(include.*\)$'`
- set includedir=/sprite/lib/$type
- d47 1
- a47 1
- echo "Generating a Makefile for headers in $type using $proto"
- @
-
-
- 1.3
- log
- @added ability to turn on echoing for all mkmf's invoked.
- @
- text
- @d32 1
- a32 6
-
- if ($?MAKEFILE) then
- set makefile=$MAKEFILE
- else
- set makefile=Makefile
- endif
- @
-
-
- 1.2
- log
- @Add code to be more careful about long lists of source files.
- @
- text
- @d17 12
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d37 8
- a44 1
- if ("$hdrs" == "${pref}*.h") set hdrs=()
- @
-